package top.lyc829.zzl_android.ui.message.praise;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.DraggableModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

import top.lyc829.zzl_android.R;
import top.lyc829.zzl_android.logic.bean.NoticeCommentBean;
import top.lyc829.zzl_android.logic.util.ReplayType;
import top.lyc829.zzl_android.logic.util.RichUtils;

public class NoticePraiseAdapter extends BaseQuickAdapter<NoticeCommentBean, BaseViewHolder> implements DraggableModule {

    public NoticePraiseAdapter() {
        super(R.layout.notice_praise_item);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, NoticeCommentBean commentBean) {
        baseViewHolder.setText(R.id.notice_praise_item_user_name, commentBean.getNickname());
        baseViewHolder.setText(R.id.notice_praise_item_content, "点赞了你");
        Glide.with(getContext())
                .load(commentBean.getUserAvatar())
                .into((ImageView) baseViewHolder.getView(R.id.notice_praise_item_avatar));
        baseViewHolder.setText(R.id.notice_praise_item_text,
                commentBean.getTopSourceId().equals(ReplayType.TRAVEL) ? RichUtils.returnOnlyText(commentBean.getText()) : commentBean.getText());
    }
}
